package h_eekwan.basic;

public class ex237 implements ex237Service {
	
	
	private String[] s= new String[10];
	private String[] a = new String[10];
	private String[] b= new String[10];
	
	public ex237(){
	for(int i = 0; 10>i;++i){
		s[i] = "--- ";
		a[i] = "--- ";
		b[i] = "--- ";
		
		}
	}

	public String getS() {
		String result = "s석>>";
		for(int i = 0; 10>i;++i){
			result += s[i]; 
		}
		return result;
		
	}

	public String getA() {
		String result = "a석>>";
		for(int i = 0 ; 10 > i; ++i){
			result += a[i];
		}
		return result;
	}
	public String getB() {
		String result = "b석>>";
		for(int i = 0 ; 10 > i; ++i){
			result += b[i];
		}
		return result;
	}

	@Override
	public boolean addRes(ex237VO v) {
		switch(v.getTypeSet()){
			case 1 : s[v.getNoSet()-1] = v.getName();
				break;
			case 2 : a[v.getNoSet()-1] = v.getName();
				break;
			case 3 : b[v.getNoSet()-1] = v.getName();
				break;
				
		}	// 예약자이름을 치면 예를들어 좌석[2]배열에 getName 이 저장되게해야 --- ---- getNamo --- --- --- .... 로 배열변수에 저장됨
		return true;
	}

	@Override
	public String readRes() {
		String result = getS(); 
		result += "\n" + getA();
		result += "\n" + getB();
		
		return result;
	}

	@Override
	public boolean upRes(ex237VO v) {
		switch(v.getTypeSet()){
		case 1 : s[v.getNoSet()-1] = "--- ";
				break;
		case 2 : a[v.getNoSet()-1] = "--- ";
			break;
		case 3 : b[v.getNoSet()-1] = "--- ";
			break;
		}
		 
		return true;
	}


	

	
	
	
}